VMS Help  —  CC  Language topics, Type Qualifiers
  Data-type qualifiers affect the allocation or access of data
  storage.  The data-type qualifiers are const, volatile, __restrict,
  and __unaligned.

1  –  const

  The const data-type qualifier restricts access to stored data.  If
  you declare an object to be of type const, you cannot modify that
  object.  You can use the const data-type qualifier with the
  volatile data-type qualifier or with any of the storage-class
  specifiers or modifiers.  The following example declares the
  variable x to be a constant integer:

       int const x;

2  –  volatile

  The volatile data-type qualifier prevents an object from being
  stored in a machine register, forcing it to be allocated in memory.
  This data-type qualifier is useful for declaring data that is to be
  accessed asynchronously.  A device driver application often uses
  volatile data storage.  Like const, you can specify the volatile
  data-type qualifier with any of the storage-class specifiers or
  modifiers with the exception of the register storage class.

3  –  __restrict

  The __restrict data-type qualifier is used to designate a pointer
  as pointing to a distinct object, thus allowing compiler
  optimizations to be made.

4  –  __unaligned

  This data-type qualifier is used in pointer definitions, indicating
  to the compiler that the data pointed to is not properly aligned on
  a correct address.  (To be properly aligned, the address of an
  object must be a multiple of the size of the type.  For example,
  two-byte objects must be aligned on even addresses.) When data is
  accessed through a pointer declared __unaligned, the compiler
  generates the additional code necessary to copy or store the data
  without causing alignment errors.  It is best to avoid use of
  misaligned data altogether, but in some cases the usage may be
  justified by the need to access packed structures, or by other
  considerations.
Close Help